package fcrpt

class OnceYieldStatisticsController {
    def dynamicQueryService
    def onceYieldStatistics(){
        def pageCurrent = params.pageCurrent ? Integer.parseInt(params.pageCurrent) : 1
        def pageSize = params.pageSize ? Integer.parseInt(params.pageSize) : 10
        params.startno = (pageSize * (pageCurrent - 1)) + 1
        params.endno = pageSize * pageCurrent
        def tableHeadList=[]
        def onceYieldStatistics=[]
        def pageSizeList = [10,20,50,100]
        def totalCount =0

            params.SYS_QUERY_NAME = 'onceYieldStatistics'
            onceYieldStatistics = dynamicQueryService.queryForList(params)
            if (onceYieldStatistics.size() > 0) {
                tableHeadList = onceYieldStatistics[0].keySet()
            }
            params.SYS_QUERY_NAME = 'onceYieldStatisticsCount'
            totalCount = dynamicQueryService.queryForList(params)[0].TOTALCOUNT

        print(params.lotId)
        [startno:params.startno?:'',
         endno:params.endno?:'',
         pageSize:pageSize,
         totalCount: totalCount,
         pageSizeList: pageSizeList,
         tableHeadList:tableHeadList,
         onceYieldStatistics:onceYieldStatistics,
         startTime:params.startTime?:'',
         endTime:params.endTime?:'',
         user:params.user?:'',
         tuhao:params.tuhao?:'',
         yield:params.yield?:''
        ]
    }
}
